/**
 * Created by My Company.
 * Date: Mar 5, 2012
 * Time: 2:30:55 PM
 * File: ExpandingMenuItemRows.java
 */
package com.mycompany.inventory.ui;

import org.zkoss.zul.Hbox;
import org.zkoss.zul.Label;
import org.zkoss.zul.Row;
import org.zkoss.zul.Rows;
import org.zkoss.zul.Textbox;
/**
 * @author loitran
 *
 */
public class ExpandingMenuItemRows extends Rows {
	/*
	  * This is just an arbitrary custom method that we can call from a zscript.
	  * In it we programmatically create all of the elements that appear in the other 
	  * rows. The code below simply creates: 
	  *  <row><label value=""/><hbox>$<textbox value=""/></hbox></row>
	  * and sets the two value attributes whatever was passed into the method. 
	  */
	 public void addRow(String nameField, String valueField){
	 Label label = new Label();
	 label.setValue(nameField);
	 Textbox textbox = new Textbox();
	 textbox.setValue(valueField);
	 Hbox hbox = new Hbox();
	 hbox.appendChild(textbox);
	 Row row = new Row();
	 row.appendChild(label);
	 row.appendChild(hbox);
	 this.appendChild(row);
	 }
}
